#pragma once
#include "../Utilities/utilities.h"
#include "Math.h"
#include "BaseCamera.h"

class LookAtCamera : public BaseCamera
{
private:
	Vector3 m_vTarget;
	Vector3 m_vUp;

	GLfloat m_fRotX;
	GLfloat m_fRotY;
	GLfloat m_fRotZ;
private:
	void UpdateNewTargetRotation();
	void MoveX(GLfloat offset);
	void MoveY(GLfloat offset);
	void MoveZ(GLfloat offset);
protected:
	virtual void UpdateWVMatrix();
public:
	///Constrtuctor
	LookAtCamera();
	void Init(Vector3 vPostion, Vector3 vTarget, Vector3 vUp,
		GLfloat fFovY, GLfloat fNearPlane, GLfloat fFarPlane);

	virtual Matrix GetWorldMatrix();
	virtual Matrix GetVPMatrix();
	virtual Vector3 GetPosition();
	virtual void SetPosition(Vector3 pos);

	///Update Camera
	virtual void Update(ESContext *esContext, GLfloat deltaTime);

	///Move Camera
	virtual void MoveLeft(GLfloat offset);
	virtual void MoveRight(GLfloat offset);
	virtual void MoveUp(GLfloat offset);
	virtual void MoveDown(GLfloat offset);
	virtual void MoveForward(GLfloat offset);
	virtual void MoveBackward(GLfloat offset);
	virtual void RotateLeft(GLfloat offset);
	virtual void RotateRight(GLfloat offset);
	virtual void RotateUp(GLfloat offset);
	virtual void RotateDown(GLfloat offset);
};